Imports CAPA_Datos
Imports CAPA_Entidad

Public Class PickingNegocio

    '*******************************************************************************************************
    Dim dao2 As New ArticuloDatos

    Function obtenerArticulo(ByVal codArticulo As String) As Articulo
        Return dao2.obtenerArticulo(codArticulo)
    End Function

    '*******************************************************************************************************
    Dim dao4 As New ArticuloUbicacionDatos

    Function actualizarStockArtUbicacion(ByVal codART As String, ByVal codUBI As String, ByVal cantidad As Integer, ByVal cantPick As Integer, ByVal tipo As String) As Boolean
        Return dao4.actualizarStockArtUbicacion(codART, codUBI, cantidad, cantPick, tipo)
    End Function

    Function listarArticulosXUbicacion(ByVal codUbicacion As String, ByVal codOrden As String, ByVal flag As String) As DataSet
        Return dao4.listarArticulosXUbicacion(codUbicacion, codOrden, flag)
    End Function

    Function obtenerStockUbicacionXArticulo(ByVal codCIA As String, ByVal codSUC As String, ByVal codALM As String, ByVal codUbicacion As String, ByVal codArticulo As String) As DataSet
        Return dao4.obtenerStockUbicacionXArticulo(codCIA, codSUC, codALM, codUbicacion, codArticulo)
    End Function

    Function verificarExistenciaUbicacionXArticulo(ByVal codUbicacion As String, ByVal codArticulo As String) As Boolean
        Return dao4.verificarExistenciaUbicacionXArticulo(codUbicacion, codArticulo)
    End Function

    Sub registrarArticuloUbicacion(ByVal au As ArticuloUbicacion)
        dao4.registrarArticuloUbicacion(au)
    End Sub

    Function obtenerUbicacionesXArticulo(ByVal codArticulo As String) As DataSet
        Return dao4.obtenerUbicacionesXArticulo(codArticulo)
    End Function

    '*******************************************************************************************************
    Dim dao5 As New BandejaDatos

    Function verificarExistenciaBandeja(ByVal codBan As String) As Boolean
        Return dao5.verificarExistenciaBandeja(codBan)
    End Function

    Function verificarEstadoBandeja(ByVal codigoBandeja As String) As String
        Return dao5.verificarEstadoBandeja(codigoBandeja)
    End Function

    Function obtenerBandejaPersona(ByVal codCIA As String, ByVal codSUC As String, ByVal codPersona As String) As DataSet
        Return dao5.obtenerBandejaPersona(codCIA, codSUC, codPersona)
    End Function

    Sub cambiarEstadoBandeja(ByVal codigoBandeja As String, ByVal estado As String)
        dao5.cambiarEstadoBandeja(codigoBandeja, estado)
    End Sub

    Function verificarBandejaItems(ByVal codigoBandeja As String, ByVal dcaCodigo As String) As Boolean
        Return dao5.verificarBandejaItems(codigoBandeja, dcaCodigo)
    End Function

    Function verificarBandejaWithItems(ByVal codCIA As String, ByVal codSUC As String, ByVal codTipo As String, ByVal codDCA As String, ByVal codDADPU As String, ByVal codBandeja As String) As Boolean
        Return dao5.verificarBandejaWithItems(codCIA, codSUC, codTipo, codDCA, codDADPU, codBandeja)
    End Function

    '***************************************************************************************************
    Dim dao6 As New CodigoBarraDatos

    Function existenciaArticuloBarra(ByVal codigoBarra As String) As DataSet
        Return dao6.existenciaArticuloBarra(codigoBarra)
    End Function

    Function verificarExistenciaXCODBARXUBI(ByVal codBarra As String, ByVal ubiCodigo As String, ByVal codOrden As String) As DataSet
        Return dao6.verificarExistenciaXCODBARXUBI(codBarra, ubiCodigo, codOrden)
    End Function

    Function obtenerProveedor(ByVal codProveedor As String) As Proveedor
        Return dao6.obtenerProveedor(codProveedor)
    End Function

    Function mostrarUnidadesMedida() As DataSet
        Return dao6.mostrarUnidadesMedida()
    End Function

    Function listarArticulosXProveedor(ByVal codProveedor As String) As DataView
        Return dao6.listarArticulosXProveedor(codProveedor)
    End Function

    Function registrarBarra(ByVal barra As ArticuloProveedorCodBarra) As String
        Return dao6.registrarBarra(barra)
    End Function

    Function listarProveedores() As DataView
        Return dao6.listarProveedores()
    End Function

    Function verificarExistenciaCODBARRA(ByVal cia As String, ByVal codBarra As String) As DataSet
        Return dao6.verificarExistenciaCODBARRA(cia, codBarra)
    End Function

    '***************************************************************************************************
    Dim dao7 As New DocumentoAlmacenDatos

    Function registrarDocumentoAlmacen(ByVal da As DocumentoAlmacen) As Boolean
        dao7.registrarDocumentoAlmacen(da)
    End Function

    Function obtenerUltimoCodigoDCA(ByVal tipoDOC As String) As Integer
        Return dao7.obtenerUltimoCodigoDCA(tipoDOC)
    End Function

    '***************************************************************************************************
    Dim dao8 As New DocumentoAlmacenDetalleDatos

    Sub registrarDocumentoAlmacenDetalle(ByVal dad As DocumentoAlmacenDetalle)
        dao8.registrarDocumentoAlmacenDetalle(dad)
    End Sub

    '***************************************************************************************************
    Dim dao9 As New DocumentoAlmacenDetallePickeadorDatos

    Sub registrarDocumentoAlmacenDetallePickeador(ByVal dadp As DocumentoAlmacenDetallePickeador)
        dao9.registrarDocumentoAlmacenDetallePickeador(dadp)
    End Sub

    Function contarPedidosPendientes(ByVal codPick As String) As Integer
        Return dao9.contarPedidosPendientes(codPick)
    End Function

    Function listarPedidosDetallePickeador(ByVal codPick As String) As DataSet
        Return dao9.listarPedidosDetallePickeador(codPick)
    End Function

    '***************************************************************************************************
    Dim dao10 As New DocumentoAlmacenDetallePickeadorUbicacionDatos

    Sub registrarDocumentoAlmacenDetallePickeadorUbicacion(ByVal dadpu As DocumentoAlmacenDetallePickeadorUbicacion)
        dao10.registrarDocumentoAlmacenDetallePickeadorUbicacion(dadpu)
    End Sub

    Sub actualizarCantidadIngresada(ByVal tipoDOC As String, ByVal cantidad As Integer, ByVal codigo As String)
        dao10.actualizarCantidadIngresada(tipoDOC, cantidad, codigo)
    End Sub

    Function generarCodigoDADPU(ByVal tdocodigo As String) As Integer
        Return dao10.generarCodigoDADPU(tdocodigo)
    End Function

    Function retomarUbicacionesPickeador(ByVal codCIA As String, ByVal codSUC As String, ByVal codTipo As String, ByVal codDCA As String, ByVal codDAP As String) As Boolean
        Return dao10.retomarUbicacionesPickeador(codCIA, codSUC, codTipo, codDCA, codDAP)
    End Function

    Function obtenerDocumentoAlmacenDetallePickeadorUbicacion(ByVal codCIA As String, ByVal codSUC As String, ByVal tdoCod As String, ByVal codDCA As String, ByVal codDADP As String, ByVal codDADPU As String) As DocumentoAlmacenDetallePickeadorUbicacion
        Return dao10.obtenerDocumentoAlmacenDetallePickeadorUbicacion(codCIA, codSUC, tdoCod, codDCA, codDADP, codDADPU)
    End Function

    '***************************************************************************************************
    Dim dao11 As New DocumentoAlmacenPickeadorDatos

    Sub registrarDocumentoAlmacenPickeador(ByVal dap As DocumentoAlmacenPickeador)
        dao11.registrarDocumentoAlmacenPickeador(dap)
    End Sub

    Function eliminarDocumentoAlmacenPickeador(ByVal codCIA As String, ByVal codSUC As String, ByVal codTDO As String, ByVal codDCA As String, ByVal codDAP As String) As Boolean
        Return dao11.eliminarDocumentoAlmacenPickeador(codCIA, codSUC, codTDO, codDCA, codDAP)
    End Function

    '***************************************************************************************************
    Dim dao12 As New DocumentoAlmacenRelacionDatos

    Sub registrarDocumentoAlmacenRelacion(ByVal ciaS As String, ByVal sucS As String, ByVal tdoS As String, ByVal dcaS As String, ByVal codDADPUSalida As Integer, ByVal ciaI As String, ByVal sucI As String, ByVal tdoI As String, ByVal dcaI As String, ByVal codDADPUIngreso As Integer)
        dao12.registrarDocumentoAlmacenRelacion(ciaS, sucS, tdoS, dcaS, codDADPUSalida, ciaI, sucI, tdoI, dcaI, codDADPUIngreso)
    End Sub

    '***************************************************************************************************
    Dim dao13 As New DocumentoClienteDetalleDatos

    Function listarDetallePedido(ByVal codCIA As String, ByVal codSUC As String, ByVal tdoc As String, ByVal codDCA As String, ByVal codDAP As String, ByVal codUbicacion As String, ByVal codArticulo As String, ByVal flag As String) As DataSet
        Return dao13.listarDetallePedido(codCIA, codSUC, tdoc, codDCA, codDAP, codUbicacion, codArticulo, flag)
    End Function

    '***************************************************************************************************
    Dim dao15 As New DocumentoClienteDetallePickeadorUbicacionBandejaDatos

    Function registrarDocumentoAlmacenDetallePickeadorUbicacionBandeja(ByVal dadpub As DocumentoAlmacenDetallePickeadorUbicacionBandeja) As Boolean
        Return dao15.registrarDocumentoAlmacenDetallePickeadorUbicacionBandeja(dadpub)
    End Function

    Sub actualizarFechaFinBandejaDADPUB(ByVal codPick As String, ByVal codBan As String, ByVal codPedido As String)
        dao15.actualizarFechaFinBandejaDADPUB(codPick, codBan, codPedido)
    End Sub

    Sub actualizarFechaFinBandejaDCDPUBAutomatico(ByVal codPick As String, ByVal codBan As String)
        dao15.actualizarFechaFinBandejaDCDPUBAutomatico(codPick, codBan)
    End Sub

    Sub actualizarCantidadBandejaDADPUB2(ByVal dadpu As Integer, ByVal bandeja As String, ByVal cant As Integer)
        dao15.actualizarCantidadBandejaDADPUB2(dadpu, bandeja, cant)
    End Sub

    Function verificarExistenciaBandejaDADPUB(ByVal dadpuCodigo As Integer, ByVal codigoBandeja As String) As Boolean
        Return dao15.verificarExistenciaBandejaDADPUB(dadpuCodigo, codigoBandeja)
    End Function

    '***************************************************************************************************
    Dim dao16 As New DocumentoClienteDetallePickeadorUbicacionDatos

    Function registrarErrorPicking(ByVal codCIA As String, ByVal codSUC As String, ByVal codTipo As String, ByVal codDCA As String, ByVal codDADP As String, ByVal codDADPU As String) As Boolean
        Return dao16.registrarErrorPicking(codCIA, codSUC, codTipo, codDCA, codDADP, codDADPU)
    End Function

    Function desactivarRegistrosDADPU(ByVal codCIA As String, ByVal codSUC As String, ByVal codTipo As String, ByVal codDCA As String, ByVal codDAP As String) As Boolean
        Return dao16.desactivarRegistrosDADPU(codCIA, codSUC, codTipo, codDCA, codDAP)
    End Function

    Function obtenerUltimoCodigoDADPU(ByVal tipoDOC As String) As Integer
        Return dao16.obtenerUltimoCodigoDADPU(tipoDOC)
    End Function

    '***************************************************************************************************
    Dim dao17 As New DocumentoClientePickeadorDatos

    Function obtenerCodigo(ByVal codPedido As String, ByVal codPick As String, ByVal tipoDOC As String) As Integer
        Return dao17.obtenerCodigo(codPedido, codPick, tipoDOC)
    End Function

    Sub actualizarFechaFinAsignacion(ByVal codPedido As String, ByVal codPick As String)
        dao17.actualizarFechaFinAsignacion(codPedido, codPick)
    End Sub

    '***************************************************************************************************
    Dim dao18 As New DocumentoAlmacenPickeadorTiempoDatos

    Function registrarDocumentoAlmacenPickeadorTiempo(ByVal dapt As DocumentoAlmacenPickeadorTiempo) As Boolean
        Return dao18.registrarDocumentoAlmacenPickeadorTiempo(dapt)
    End Function

    Function actualizarTiempoFinStandBy(ByVal dapt As DocumentoAlmacenPickeadorTiempo) As Boolean
        Return dao18.actualizarTiempoFinStandBy(dapt)
    End Function

    Function obtenerDocumentoAlmacenPickeadorTiempo(ByVal codCIA As String, ByVal codSUC As String, ByVal tdoCod As String, ByVal codDCA As String, ByVal codDAP As String) As DocumentoAlmacenPickeadorTiempo
        Return dao18.obtenerDocumentoAlmacenPickeadorTiempo(codCIA, codSUC, tdoCod, codDCA, codDAP)
    End Function

    '***************************************************************************************************
    Dim dao19 As New EmpresaDatos

    Function listarEmpresas() As DataSet
        Return dao19.listarEmpresas()
    End Function

    '***************************************************************************************************
    Dim dao20 As New MensajeDatos

    Function leerMensajes(ByVal codPickeador As String) As String
        Return dao20.leerMensajes(codPickeador)
    End Function

    '***************************************************************************************************
    Dim dao21 As New PickeadorDatos

    Sub actualizarBandejaXPickeador(ByVal codPick As String, ByVal codBan As String, ByVal tipo As String, ByVal fecha As String)
        dao21.actualizarBandejaXPickeador(codPick, codBan, tipo, fecha)
    End Sub

    Function eliminarBandejaXPickeador(ByVal codPick As String, ByVal codCia As String, ByVal codSuc As String, ByVal codAlm As String) As Boolean
        Return dao21.eliminarBandejaXPickeador(codPick, codCia, codSuc)
    End Function

    '***************************************************************************************************
    Dim dao22 As New SucursalDatos

    Function listarSucursales(ByVal codEmp As String) As DataSet
        Return dao22.listarSucursales(codEmp)
    End Function

    '***************************************************************************************************
    Dim dao23 As New TrasladoDatos

    'Function contarTrasladosPendientes(ByVal codPickeador As String) As Integer
    '    Return dao23.contarTrasladosPendientes(codPickeador)
    'End Function

    Function listarTrasladosPendientes(ByVal codPickeador As String) As DataSet
        Return dao23.listarTrasladosPendientes(codPickeador)
    End Function

    '***************************************************************************************************

    Dim dao24 As New UbicacionDatos

    Function actualizarAsignadoArticuloUbicacion(ByVal codArt As String, ByVal codUbi As String, ByVal cantidad As Integer, ByVal tipo As String) As Boolean
        Return dao24.actualizarAsignadoArticuloUbicacion(codArt, codUbi, cantidad, tipo)
    End Function

    Function obtenerUbicacionDisponible(ByVal codCIA As String, ByVal codSUC As String, ByVal codTipo As String, ByVal codDCA As String, ByVal codArticulo As String, ByVal cantidad As Integer) As String
        Return dao24.obtenerUbicacionDisponible(codCIA, codSUC, codTipo, codDCA, codArticulo, cantidad)
    End Function

    Function verificarExistenciaUbicacion(ByVal codUbicacion As String) As DataSet
        Return dao24.verificarExistenciaUbicacion(codUbicacion)
    End Function

    '***************************************************************************************************
    Dim dao25 As New UsuarioDatos

    Function obtenerUsuario(ByVal codCIA As String, ByVal codSUC As String, ByVal codUsuario As String, ByVal contrasenia As String)
        Return dao25.obtenerUsuario(codCIA, codSUC, codUsuario, contrasenia)
    End Function

    '***************************************************************************************************
    Dim dao26 As New OrdenCompraDatos

    Function obtenerOrdenesCompra() As DataSet
        Return dao26.obtenerOrdenesCompra()
    End Function

    '***************************************************************************************************

    Dim dao27 As New DocumentoClienteDatos

    Function obtenerDocumentoCliente(ByVal ciaCodigo As String, ByVal sucCodigo As String, ByVal tdocCodigo As String, ByVal codDCI As String) As DocumentoCliente
        Return dao27.obtenerDocumentoCliente(ciaCodigo, sucCodigo, tdocCodigo, codDCI)
    End Function

    '***************************************************************************************************
    Dim dao28 As New DocumentosAlmacenDatos

    Function actualizarFechasInicio(ByVal codCIA As String, ByVal codSUC As String, ByVal tdoCod As String, ByVal codDCA As String, _
                                    ByVal codDAP As String, ByVal codDADP As String, ByVal codDADPU As String) As Boolean
        Return dao28.actualizarFechasInicio(codCIA, codSUC, tdoCod, codDCA, codDAP, codDADP, codDADPU)
    End Function

    Function actualizarCantidadesFechas(ByVal codCIA As String, ByVal codSUC As String, ByVal tdoCod As String, ByVal codDCA As String, _
                                        ByVal codDAP As String, ByVal codDADP As String, ByVal codDADPU As String, ByVal cantidad As Integer, ByVal flag As String) As Boolean
        Return dao28.actualizarCantidadesFechas(codCIA, codSUC, tdoCod, codDCA, codDAP, codDADP, codDADPU, cantidad, flag)
    End Function

End Class
